import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/view/layout/LayoutPage.vue'
import Home from '@/view/home/HomeP.vue'
import ProdList from '@/view/product/ProdList.vue'
import ProdCategory from '@/view/product/ProdCategory.vue'
import Login from '@/view/login/LoginPage.vue'

const routes = [
    { 
        path: '/', 
        redirect:'/home',
        component: Layout ,
        children:[
            {
                path:'home',
                name:'home',
                component: Home
            },
            {
                path:'prod-list',
                name:'prod-list',
                component: ProdList
            },
            {
                path:'prod-category',
                name:'prod-category',
                component: ProdCategory
            }
        ]
    },
    { path: '/login', name: 'login', component: Login }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router